package com.example.interfaces.dto;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import com.example.infrastructure.excel.ExcelExportable;
import com.example.infrastructure.excel.ExcelImportable;
import cn.idev.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import jakarta.validation.constraints.*;

/**
 * 支付订单表 DTO
 *
 * @author wangal
 * @since 2025-07-25
 */
@Data
@Schema(name = "PaymentOrdersDTO", description = "支付订单表DTO")
public class PaymentOrdersDTO implements ExcelExportable, ExcelImportable {

    @Schema(description = "订单号")
    @ExcelProperty("订单号")
    @NotBlank(message = "订单号不能为空")
    private String orderNo;
    
    @Schema(description = "用户ID")
    @ExcelProperty("用户ID")
    @NotNull(message = "用户ID不能为空")
    private Long userId;
    
    @Schema(description = "订单类型：1问诊费，2药品费，3挂号费")
    @ExcelProperty("订单类型：1问诊费，2药品费，3挂号费")
    private Byte orderType;
    
    @Schema(description = "关联ID(问诊ID或处方ID或预约ID)")
    @ExcelProperty("关联ID(问诊ID或处方ID或预约ID)")
    @NotNull(message = "关联ID(问诊ID或处方ID或预约ID)不能为空")
    private Long relatedId;
    
    @Schema(description = "订单标题")
    @ExcelProperty("订单标题")
    @NotBlank(message = "订单标题不能为空")
    private String orderTitle;
    
    @Schema(description = "订单金额")
    @ExcelProperty("订单金额")
    private BigDecimal amount;
    
    @Schema(description = "优惠金额")
    @ExcelProperty("优惠金额")
    private BigDecimal discountAmount;
    
    @Schema(description = "实付金额")
    @ExcelProperty("实付金额")
    private BigDecimal actualAmount;
    
    @Schema(description = "支付方式：0未支付，1微信支付，2支付宝，3余额支付")
    @ExcelProperty("支付方式：0未支付，1微信支付，2支付宝，3余额支付")
    private Byte paymentMethod;
    
    @Schema(description = "状态：0待支付，1已支付，2已退款，3已取消，4支付失败")
    @ExcelProperty("状态：0待支付，1已支付，2已退款，3已取消，4支付失败")
    private Byte status;
    
    @Schema(description = "第三方支付交易号")
    @ExcelProperty("第三方支付交易号")
    @NotBlank(message = "第三方支付交易号不能为空")
    private String tradeNo;
    
    @Schema(description = "支付时间")
    @ExcelProperty("支付时间")
    private LocalDateTime payTime;
    
    @Schema(description = "退款时间")
    @ExcelProperty("退款时间")
    private LocalDateTime refundTime;
    
    @Schema(description = "退款原因")
    @ExcelProperty("退款原因")
    @NotBlank(message = "退款原因不能为空")
    private String refundReason;
    
    @Schema(description = "过期时间")
    @ExcelProperty("过期时间")
    private LocalDateTime expireTime;
    
    @Schema(description = "租户编号")
    @ExcelProperty("租户编号")
    @NotNull(message = "租户编号不能为空")
    private Long tenantId;
    
}
